.TH g_bar 1 "Thu 26 Aug 2010" "" "GROMACS suite, VERSION 4.5"
.SH NAME
g_bar - calculates free energy difference estimates through Bennett's acceptance ratio

.B VERSION 4.5
.SH SYNOPSIS
\f3g_bar\fP
.BI "\-f" " dhdl.xvg "
.BI "\-o" " bar.xvg "
.BI "\-oi" " barint.xvg "
.BI "\-oh" " histogram.xvg "
.BI "\-g" " energy.edr "
.BI "\-[no]h" ""
.BI "\-[no]version" ""
.BI "\-nice" " int "
.BI "\-[no]w" ""
.BI "\-xvg" " enum "
.BI "\-b" " real "
.BI "\-e" " real "
.BI "\-temp" " real "
.BI "\-prec" " int "
.BI "\-nbmin" " int "
.BI "\-nbmax" " int "
.BI "\-nbin" " int "
.SH DESCRIPTION
\&g_bar calculates free energy difference estimates through 
\&Bennett's acceptance ratio method. 
\&Input option \fB \-f\fR expects multiple dhdl files. 
\&Two types of input files are supported:

\&* Files with only one y\-value, for such files it is assumed 
\&that the y\-value is dH/dlambda and that the Hamiltonian depends 
\&linearly on lambda. The lambda value of the simulation is inferred 
\&from the subtitle if present, otherwise from a number in the
\&subdirectory in the file name.
\&

\&* Files with more than one y\-value. The files should have columns 
\&with dH/dlambda and Delta lambda. The lambda values are inferred 
\&from the legends: 
\&lambda of the simulation from the legend of dH/dlambda 
\&and the foreign lambda's from the legends of Delta H.


\&The lambda of the simulation is parsed from dhdl.xvg file's legend 
\&containing the string 'dH', the foreign lambda's from the legend 
\&containing the capitalized letters 'D' and 'H'. The temperature 
\&is parsed from the legend line containing 'T ='.


\&The free energy estimates are determined using BAR with bisection, 
\&the precision of the output is set with \fB \-prec\fR. 
\&An error estimate taking into account time correlations 
\&is made by splitting the data into blocks and determining 
\&the free energy differences over those blocks and assuming 
\&the blocks are independent. 
\&The final error estimate is determined from the average variance 
\&over 5 blocks. A range of blocks numbers for error estimation can 
\&be provided with the options \fB \-nbmin\fR and \fB \-nbmax\fR.


\&The results are split in two parts: the last part contains the final 
\&results in kJ/mol, together with the error estimate for each part 
\&and the total. The first part contains detailed free energy 
\&difference estimates and phase space overlap measures in units of 
\&kT (together with their computed error estimate). The printed 
\&values are:

\&*  lam_A: the lambda values for point A.

\&*  lam_B: the lambda values for point B.

\&*     DG: the free energy estimate.

\&*    s_A: an estimate of the relative entropy of B in A.

\&*    s_A: an estimate of the relative entropy of A in B.

\&*  stdev: an estimate expected per\-sample standard deviation.


\&The relative entropy of both states in each other's ensemble can be 
\&interpreted as a measure of phase space overlap: 
\&the relative entropy s_A of the work samples of lambda_B in the 
\&ensemble of lambda_A (and vice versa for s_B), is a 
\&measure of the 'distance' between Boltzmann distributions of 
\&the two states, that goes to zero for identical distributions. See 
\&Wu & Kofke, J. Chem. Phys. 123 084109 (2009) for more information.
\&


\&The estimate of the expected per\-sample standard deviation, as given 
\&in Bennett's original BAR paper: 
\&Bennett, J. Comp. Phys. 22, p 245 (1976), Eq. 10 gives an estimate 
\&of the quality of sampling (not directly of the actual statistical 
\&error, because it assumes independent samples).


.SH FILES
.BI "\-f" " dhdl.xvg" 
.B Input, Opt., Mult.
 xvgr/xmgr file 

.BI "\-o" " bar.xvg" 
.B Output, Opt.
 xvgr/xmgr file 

.BI "\-oi" " barint.xvg" 
.B Output, Opt.
 xvgr/xmgr file 

.BI "\-oh" " histogram.xvg" 
.B Output, Opt.
 xvgr/xmgr file 

.BI "\-g" " energy.edr" 
.B Input, Opt., Mult.
 Energy file 

.SH OTHER OPTIONS
.BI "\-[no]h"  "no    "
 Print help info and quit

.BI "\-[no]version"  "no    "
 Print version info and quit

.BI "\-nice"  " int" " 0" 
 Set the nicelevel

.BI "\-[no]w"  "no    "
 View output xvg, xpm, eps and pdb files

.BI "\-xvg"  " enum" " xmgrace" 
 xvg plot formatting: \fB xmgrace\fR, \fB xmgr\fR or \fB none\fR

.BI "\-b"  " real" " 0     " 
 Begin time for BAR

.BI "\-e"  " real" " \-1    " 
 End time for BAR

.BI "\-temp"  " real" " \-1    " 
 Temperature (K)

.BI "\-prec"  " int" " 2" 
 The number of digits after the decimal point

.BI "\-nbmin"  " int" " 5" 
 Minimum number of blocks for error estimation

.BI "\-nbmax"  " int" " 5" 
 Maximum number of blocks for error estimation

.BI "\-nbin"  " int" " 100" 
 Number of bins for histogram output

.SH SEE ALSO
.BR gromacs(7)

More information about \fBGROMACS\fR is available at <\fIhttp://www.gromacs.org/\fR>.
